package designclass;

/**
 * @BelongsProject: DataStructures
 * @BelongsPackage: designclass
 * @Author: 江岸
 * @CreateTime: 2021-04-21 21:25
 * @Description: 不用锁写单例设计模式：1.静态块 2.内部类 3.枚举（枚举其实是把枚举对象当作静态熟悉初始化）
 */
public class Singlton {

    public static Singlton getInstance(){
        return InnerClass.singlton;
    }

    private static class InnerClass{
        private static final Singlton singlton = new Singlton();
    }
}
